package cn.darkhorse.device.iot.constant;

public interface IotConstant {
    // 正常
    int DATA_FLAG_SUCCESS = 1;
    // 解析过程中出现错误
    int DATA_FLAG_ERROR = 2;
    // 没有建表
    int DATA_FLAG_NO_HISTORY_TABLE = 3;
    // 历史表前缀
    String HISTORY_TABLE_NAME_PRE = "history_";
    String HISTORY_DAY_TABLE_NAME_DAY= "_day";


    // 历史表中的各个字段
    String FIELD_NAME_CREATED_AT = "created_at";
    String FIELD_NAME_GATEWAY_DEVICE_ID = "gateway_device_id";

    /**
     * 缓存
     */
    // 存储实时数据
    String CACHE_MQTT_DATA_REAL_DATA = "MqttData:RealData:";
    // 存储mqtt_data表中最后处理的一条记录的id
    String CACHE_MQTT_DATA_LAST_ID = "MqttData:LastId";
    String CACHE_MQTT_DATA_DO_FLAG = "MqttData:doFlag";

    // 存储预警设置参数
    String CACHE_MQTT_ALARM_PARAMS = "MqttData:AlarmParams:";
    String CACHE_MQTT_LIVE_ALARM_DATA = "MqttData:LiveAlarmRecords:";
    // 存储点表信息
    String CACHE_MQTT_POINT_TABLE = "MqttData:PointTable:";
    // 存储判断设备状态的配置参数
    String CACHE_MQTT_DEVICE_STATUS = "MqttData:DeviceStatus:";

    // 超时时间， 30 天
    Integer CACHE_MQTT_TIMEOUT = 30;
    // 设备离线判断时间
    Integer DEVICE_ONLINE_TIMEOUT = 90;

    /**
     * 点表数据类型
     */
    Integer POINT_TYPE_BOOLEAN = 0;
    Integer POINT_TYPE_NUMBER = 1;
    Integer POINT_TYPE_STRING = 2;
    Integer POINT_TYPE_ENUM = 3;

    /**
     * 设备状态
     */
    String DEVICE_STATUS_ONLINE = "online";
    String DEVICE_STATUS_OFFLINE = "offline";
    String DEVICE_STATUS_RUN = "run";
    String DEVICE_STATUS_STOP = "stop";
    String DEVICE_STATUS_ALARM = "alarm";
    String DEVICE_STATUS_MAINTENANCE = "maintenance";
    String DEVICE_STATUS_ALL = "all";
    /**
     * 设备状态配置信息字段
     */
    String DEVICE_STATUS_PARAM_FIELD_YES = "yes";
    String DEVICE_STATUS_PARAM_FIELD_NO = "no";
    String DEVICE_STATUS_PARAM_FIELD_STATUS_TYPE_RUN = "deviceRun";
    String DEVICE_STATUS_PARAM_FIELD_STATUS_TYPE_ALARM = "deviceAlarm";
    String DEVICE_STATUS_PARAM_FIELD_STATUS_TYPE_MAINTENANCE = "deviceMaintenance";

    String POINT_ID = "pointId";
    String STATUS_TYPE = "statusType";


}
